package com.lagou.task12;

public class StringMechesTest {
    public static void main(String[] args) {
        String str1 = "1000,张飞,30";
        System.out.println(str1);
        //split
        String[] strarr = str1.split(",");
        System.out.println("打印字符串数组");
        for (int i = 0; i < strarr.length; i++){
            System.out.println(strarr[i]);
        }
        System.out.println("----------------------------");
        //replece
        String str2 = "my name is liyulin";
        String str3 = str2.replace(" ","--");
        System.out.println(str3);
        System.out.println("----------------------------");
        //replaceFirst()
        String str4 = "123qwe567assdd6575fgd";
        String str5 = str4.replaceFirst("[\\d+]","#");
        System.out.println(str5);
        String str6 = str4.replaceAll("[\\d+]","#");
        System.out.println(str6);
    }
}
